package Leo.webservice.impl;

import Leo.webservice.DemoWebservice;
import org.springframework.stereotype.Service;

import javax.jws.WebService;

@WebService(serviceName = "demoWebservice", // 与接口中指定的name一致
        targetNamespace = "http://webservice.Leo/", // 与接口中的命名空间一致,一般是接口的包名倒
        endpointInterface = "Leo.webservice.DemoWebservice"// 接口地址
)
@Service("demoWebService")
public class DemoWebserviceImpl implements DemoWebservice {


    @Override
    public String sayHello(String param) throws Exception {
        System.out.println(param);
        param = param.replace("+lt+", "<");
        param = param.replace("+qt+", ">");
        System.out.println("trans finish!");
        System.out.println(param);
        return "hello:" + param;
    }

    @Override
    public String sayYes() throws Exception {
        return "<root><result>yes</result><code>abc</code></root>";
    }

    @Override
    public String sayObject(Object object) {
        System.out.println("object comming");
        String string = object.toString();
        System.out.println(string);
        return "get Object";
    }

    @Override
    public String callHis(String className, String method, String param) {
        System.out.println(className);
        System.out.println(method);
//        param = param.replace("+lt+", "<");
//        param = param.replace("+qt+", ">");
        System.out.println(param);
        return param;
    }

    ;
}
